package com.cn.design.adapter.object;

import com.cn.design.adapter.classes.SDCard;
import com.cn.design.adapter.classes.TFCard;

/**
 * @author: zhangyiting
 * @description:
 * @createDate: Created in 2022/7/7 22:32
 * @version: 1.0
 */
//创建适配器对象（SD兼容TF）
public class SDAdapterTF  implements SDCard {
    private TFCard tfCard;
    public SDAdapterTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter read tf card ");
        return tfCard.readTF();
    }
    @Override
    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(msg);
    }
}